#include <ctype.h>
#include <stdio.h>

#define MAXLINE 100

int main()
{
    double sum, atof(char[]);
    char line[MAXLINE];
    int get_line(char line[], int max);
    int atoi(char[]);

    while (get_line(line, MAXLINE) > 0)
    {
        printf("\t%g\n", atof(line));
        printf("\t%d\n", atoi(line));
    }
    return 0;
}

int get_line(char s[], int limit)
{
    int c, i;

    i = 0;
    while (--limit > 0 && (c = getchar()) != EOF && c != '\n')
    {
        s[i++] = c;
    }
    if (c == '\n')
    {
        s[i++] = c;
    }
    s[i] = '\0';
    return i;
}

double atof(char s[])
{
    double value, power;
    int i, sign;

    for (i = 0; isspace(s[i]); i++)
    {
        ;
    }

    sign = (s[i] == '-') ? -1 : 1;

    if (s[i] == '+' || s[i] == '-')
    {
        i++;
    }

    for (value = 0.0; isdigit(s[i]); i++)
    {
        value = 10.0 * value + (s[i] - '0');
    }

    if (s[i] == '.')
    {
        i++;
    }

    for (power = 1.0; isdigit(s[i]); i++)
    {
        value = 10.0 * value + (s[i] - '0');
        power *= 10.0;
    }

    return sign * value / power;
}

int atoi(char s[])
{
    double atof(char s[]);
    return (int)atof(s);
}